package com.netease.cloud.cm.model.request;

import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

@Data
public class AdminUserRequest implements Serializable {
	private static final long serialVersionUID = 103050810596108428L;

	private String id;

	private String username;

	private String password;

	private String namespceId;

	private String namespce;

	private Integer roleType;

	private String email;

	private Boolean enableStatus;

	private Integer loginCount;

	private String lastLoginIp;

	public AdminUserRequest() {
	}

	public AdminUserRequest(String id, String username, String password, String namespce, Integer roleType, String email, Boolean enableStatus) {
		this.id = id;
		this.username = username;
		this.password = password;
		this.namespce = namespce;
		this.roleType = roleType;
		this.email = email;
		this.enableStatus = enableStatus;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof AdminUserRequest)) {
			return false;
		}
		AdminUserRequest adminUser = (AdminUserRequest) o;
		return getId().equals(adminUser.getId()) &&
				getUsername().equals(adminUser.getUsername()) &&
				getPassword().equals(adminUser.getPassword()) &&
				getNamespce().equals(adminUser.getNamespce()) &&
				getRoleType().equals(adminUser.getRoleType()) &&
				getEmail().equals(adminUser.getEmail()) &&
				getEnableStatus().equals(adminUser.getEnableStatus());
	}

	@Override
	public int hashCode() {
		return Objects.hash(getId(), getUsername(), getPassword(), getNamespce(), getRoleType(), getEmail(), getEnableStatus());
	}
}

